﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Linq;
using System.Text;

namespace DapperWrapper
{
    public class AccountContext : IDbContext
    {
       // public static ServerAnswer _answer=new ServerAnswer();

        public static string _systemDataConnectionString;

        public static string SystemDataConnectionString
        {
            get
            {
                //if (_answer.Server == null) return string.Empty;
                //return _systemDataConnectionString = string.Format(
                //    @"data source={0};initial catalog={1};user id={2};password={3}",
                //   string.Format("{0};pooling=true;min pool size=1;max pool size=1;Connection Timeout=0", _answer.Server), "master", _answer.User, _answer.Pwd);
                return "";
            }
        }

        public IDbConnection GetConnection()
        {
            DbConnection connection = new SqlConnection(SystemDataConnectionString);
            return connection;
        }

        public string ContextName
        {
            get { return "AccountSource"; }
        }
    }
}
